package org.kealinghornets.jchuah.buttons;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;


public class MainActivity extends ActionBarActivity {
    View left_purple;
    View middle_purple;
    View right_purple;

    public void onButton_LeftPush(View view) {
        Log.d("YourFace"  , "LEFT BUTTON IS BEING PUSHED!!!! Hi - Dodie");
        Toast.makeText(this, "You are now L33T H4x0R", Toast.LENGTH_SHORT).show();
        if(left_purple.getVisibility()==View.VISIBLE){
            left_purple. setVisibility(View.INVISIBLE);
        }
        else{
            left_purple. setVisibility(View.VISIBLE);
        }
    }
    public void onButton_MiddlePush(View view) {
        Log.d("YourFace"  , "MIDDLE BUTTON IS BEING PUSHED!!!! Hi - Dodie");
        Toast.makeText(this, "Toast sandwich", Toast.LENGTH_SHORT).show();
        if(middle_purple.getVisibility()==View.VISIBLE){
            middle_purple. setVisibility(View.INVISIBLE);
        }
        else{
            middle_purple. setVisibility(View.VISIBLE);
        }
    }
    public void onButton_RightPush(View view) {
        Log.d("YourFace"  , "RIGHT BUTTON IS BEING PUSHED!!!! Hi - Dodie");
        Toast.makeText(this, "Good job. You pressed a button.", Toast.LENGTH_SHORT).show();
        if(right_purple.getVisibility()==View.VISIBLE){
            right_purple. setVisibility(View.INVISIBLE);
        }
        else{
            right_purple. setVisibility(View.VISIBLE);
        }
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        left_purple = findViewById(R.id.left_purple);
        middle_purple = findViewById(R.id.middle_purple);
        right_purple = findViewById(R.id.right_purple);

    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}
